package com.example.designpatterns.observer;

/**
 * 具体目标-猫
 */
public class Cat extends MySubject {
    @Override
    public void cry() {
        System.out.println("猫叫!");
        System.out.println("-----------------------------------------");
        //遍历了观察者集合,调用每一个观察者对象的response()响应方法
        for (Object obs : observers) {
            ((MyObserver) obs).response();
        }
    }
}